package face.pay.web.enterprise.controller.profit;

import face.pay.common.enterprise.service.IprofitBaseService;
import face.pay.entity.ProfitInfo;
import face.pay.entity.UserInfo;
import face.pay.security.annotation.CurrentUser;
import face.pay.security.exception.BaseException;
import face.pay.util.ResultMessage;
import face.pay.util.page.PageData;
import face.pay.util.page.PageParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Auther: zkj
 * @Date: 2019/7/12 10:39
 * @Description:
 */
@Controller
@RequestMapping("/enterprise_profit")
public class ProfitController {

    @Autowired
    private IprofitBaseService iprofitService;

    @RequestMapping("/list")
    public String manager(){

        return  "enterprise/profit_list";
    }

    @RequestMapping("/edit")
    @ResponseBody
    public ResultMessage editUser(@CurrentUser UserInfo loginUser, ProfitInfo profitInfo) throws BaseException {


        return iprofitService.modifyInfo(profitInfo,loginUser);

    }


    @RequestMapping("/queryData")
    @ResponseBody
    public PageData data(PageParam pageParam, @CurrentUser  UserInfo loginUser) throws BaseException {

        return  this.iprofitService.queryPage(loginUser,pageParam);

    }



}
